#pragma once
#include<vector>
#include<list>
#include <string>
#define Version(x,y) (unsigned int)(((unsigned short)(x)) << 16) | ((unsigned short)(y))
struct FaceInfo
{
	std::vector<float> features;
	unsigned int id;
};
class FaceFile
{
public:
	FaceFile();
	~FaceFile();
public:
	//添加一个特征值🏡
	void Add(std::vector<float> & features, long id = 0);
	void Add(std::vector<float> && features, long id = 0);
	//将当前特征值链表移动出来（内部链表将制空）
	std::list<FaceInfo> && MoveList();
	//存入(存入文件命，版本号)
	bool Save(std::string save_to, unsigned int version = Version(1, 0));
	//读取
	bool Load(std::string path);
private:
	bool HasVer(unsigned int version);
	bool SaveVer1_0(std::fstream & save);
	bool LoadVer1_0(std::fstream & save);
private:
	std::list<FaceInfo> save_data;
};

